import Main from '@/components/main'
import Home from '@/components/home/home'
import InCompany from '@/components/in-company/in-company'
import InCompanyIntro from '@/components/in-company/in-company-intro'
import InCompanyCult from '@/components/in-company/in-company-cult'
import CapIntro from '@/components/cap-intro/cap-intro'
import CapIntroDetail from '@/components/cap-intro/cap-intro-detail'
import JoinUS from '@/components/join-us/join-us'
import CallUS from '@/components/call-us/call-us'

export const loginRouter = {
  path: '/login',
  component: () => import('@/components/login/login')
}

export const appRouter = [
  {
    path: 'home',
    component: Home
  },
  {
    meta: {
      title: '走进虎匠'
    },
    path: '/company',
    component: InCompany,
    redirect: '/company/intro',
    children: [
      {
        meta: {
          title: '企业介绍'
        },
        path: 'intro',
        component: InCompanyIntro
      }, {
        meta: {
          title: '企业文化'
        },
        path: 'cult',
        component: InCompanyCult
      }
    ]
  }, {
    meta: {
      title: '班组介绍'
    },
    path: '/capintro',
    component: CapIntro,
    children: [
      {
        meta: {
          title: '班组详情'
        },
        path: ':id',
        component: CapIntroDetail
      }
    ]
  }, {
    meta: {
      title: '加入我们'
    },
    path: '/joinus',
    component: JoinUS
  }, {
    meta: {
      title: '联系我们'
    },
    path: '/callus',
    component: CallUS
  }
]

export const mainRouter = [
  {
    meta: {
      title: '首页'
    },
    path: '/',
    redirect: '/home',
    component: Main,
    children: appRouter
  }
]

export const routers = [
  loginRouter,
  ...mainRouter
]
